<?php
// -----------------------------------------------------------------------------
// include
// -----------------------------------------------------------------------------

include "../config/config.php";
include "../auth.php";
include "../DBManager.php";

// -----------------------------------------------------------------------------
// 访问相关设置
// -----------------------------------------------------------------------------

if (!(isset($_GET["idOne"]) && isset($_GET["idTwo"]) && isset($_GET["sortNumberOne"]) && isset($_GET["sortNumberTwo"]))) {
    exit("需要传入有效的参数！");
}

$idOne = $_GET["idOne"];
$idTwo = $_GET["idTwo"];
$sortNumberOne = $_GET["sortNumberOne"];
$sortNumberTwo = $_GET["sortNumberTwo"];

// -----------------------------------------------------------------------------
// 数据库相关设置
// -----------------------------------------------------------------------------

$dbPath = "../" . $dbPath; // 不加这行语句的话会报错，提示找不到对应路径
$db = new DBManager("sqlite:" . $dbPath);

// -----------------------------------------------------------------------------

$db->changeSortNumberOfShoppingList($idOne, "foo");
$db->changeSortNumberOfShoppingList($idTwo, $sortNumberOne);
$db->changeSortNumberOfShoppingList($idOne, $sortNumberTwo);
